//
//  WSMyTableCell.m
//  WisdomStar
//
//  Created by 谭飞 on 2018/10/22.
//  Copyright © 2018年 zhangliwen. All rights reserved.
//

#import "WSMyTableCell.h"

@implementation WSMyTableCell

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];
    
    // Configure the view for the selected state
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self setUpViews];
    }
    return self;
}

- (void)setUpViews {
    self.selectionStyle = UITableViewCellSelectionStyleNone;
    
    self.leftIcon = [[UIImageView alloc] init];
    [self.contentView addSubview:self.leftIcon];
    
    [self.leftIcon mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.centerY.offset(0);
    }];
    
    self.titleLabel = [[UILabel alloc] init];
    self.titleLabel.font = WSFontMake(15);
    self.titleLabel.textColor = kFontColorBlack;
    [self.contentView addSubview:self.titleLabel];
    
    [self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftIcon.mas_right).offset(12);
        make.centerY.offset(0);
    }];
    
    self.detailLabel = [[UILabel alloc] init];
    self.detailLabel.font = WSFontMake(13);
    self.detailLabel.textColor = COLOR_HEX(0x555555);
    [self.contentView addSubview:self.detailLabel];
    
    [self.detailLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.offset(-10);
        make.centerY.offset(0);
    }];
}

- (void)setFrame:(CGRect)frame {
    frame.origin.x = 12.f;
    frame.size.width -= frame.origin.x * 2;
    frame.size.height = 50.f;
    
    [super setFrame:frame];
}

@end

